package com.sky.article;

/*
@description:
@ClassName AbstractCheck
@author chen
@create 2024-09-11 23:15
@Version 1.0
*/
public abstract class AbstractCheck implements IArticlePublishCheck {

    private IArticlePublishCheck next;

    @Override
    public void checkRequest(ArticlePublishRequest request) {
        this.check(request);
        if(null != next){
            next.checkRequest(request);
        }
    }

    protected abstract void check(ArticlePublishRequest request);

    @Override
    public IArticlePublishCheck next(IArticlePublishCheck next) {
        this.next = next;
        return this.next;
    }
}
